home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form frm4_3_3
- Caption = "Right Triangle"
- ClientHeight = 2610
- ClientLeft = 1935
- ClientTop = 1740
- ClientWidth = 2475
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- LinkTopic = "Form1"
- PaletteMode = 1 'UseZOrder
- ScaleHeight = 2610
- ScaleWidth = 2475
- Begin VB.PictureBox picHyp
- Height = 255
- Left = 1320
- ScaleHeight = 195
- ScaleWidth = 915
- TabIndex = 6
- Top = 2160
- Width = 975
- End
- Begin VB.CommandButton cmdCalculate
- Caption = "Calculate Hypotenuse"
- Height = 495
- Left = 240
- TabIndex = 4
- Top = 1320
- Width = 2055
- End
- Begin VB.TextBox txtSideTwo
- Height = 285
- Left = 1320
- TabIndex = 3
- Top = 840
- Width = 975
- End
- Begin VB.TextBox txtSideOne
- Height = 285
- Left = 1320
- TabIndex = 2
- Top = 240
- Width = 975
- End
- Begin VB.Label lblHyp
- Caption = "Length of hypotenuse"
- Height = 495
- Left = 240
- TabIndex = 5
- Top = 2040
- Width = 975
- End
- Begin VB.Label lblSideTwo
- Caption = "Length of other side"
- Height = 375
- Left = 240
- TabIndex = 1
- Top = 720
- Width = 975
- WordWrap = -1 'True
- End
- Begin VB.Label lblSideOne
- Caption = "Length of one side"
- Height = 375
- Left = 240
- TabIndex = 0
- Top = 120
- Width = 975
- WordWrap = -1 'True
- End
- Attribute VB_Name = "frm4_3_3"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Private Sub cmdCalculate_Click()
- Dim a As Single, b As Single
- 'Calculate length of the hypotenuse of a right triangle
- a = Val(txtSideOne.Text)
- b = Val(txtSideTwo.Text)
- picHyp.Cls
- picHyp.Print Hypotenuse(a, b)
- End Sub
- Private Function Hypotenuse(a As Single, b As Single) As Single
- 'Calculate the hypotenuse of a right triangle
- 'having sides of lengths a and b
- Hypotenuse = Sqr(a ^ 2 + b ^ 2)
- End Function
-